package fudan.se.lab2.service;

import fudan.se.lab2.domain.Meeting;
import fudan.se.lab2.repository.MeetingRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class WheelChairUtilService {
    private final MeetingRepository meetingRepository;

    @Autowired
    public WheelChairUtilService(MeetingRepository meetingRepository) {
        this.meetingRepository = meetingRepository;
    }

    public List<Meeting> allMeetings() {
        Iterable<Meeting> it = meetingRepository.findAll();
        List<Meeting> allMeetings = new ArrayList<>();
        for (Meeting meeting : it) {
            allMeetings.add(meeting);
        }
        return allMeetings;
    }
}
